package cn.com.lookang.robot.dao;

import cn.com.lookang.robot.entity.PlayRealmEntity;
import cn.com.lookang.robot.entity.RealmPlayerInfoEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * <p>
 * 开团信息表
 * </p>
 *
 * @author lookang
 * @since 2020-07-25
 */
public interface PlayRealmDao extends PagingAndSortingRepository<PlayRealmEntity, String>, JpaSpecificationExecutor<PlayRealmEntity> {


    /**
     *
     * @param realmName
     * @return
     */
    @Query(nativeQuery = true , value = "select * from play_realm where realm_name = ?1 order by play_date limit 1")
    PlayRealmEntity getPlayRealmByRealmName(String realmName);

    @Query(nativeQuery = true , value = "select * from play_realm order by play_date limit 1")
    PlayRealmEntity getPlayRealmLast();
}
